<script setup lang="ts">
import { ref } from 'vue';
// js写法
// const count = ref(0)

// ts写法 简单的数据类型推荐省略<类型>
// const count = ref<number>(0)
  const count = ref(0)
// 复杂类型

type ToDoitem = {
  id: number
  name: string
  done: boolean
}

const list = ref<ToDoitem[]>([])

setTimeout(() => {
  list.value = [
    {id: 1, name:'张三', done: false},
    {id: 2, name:'李四', done: true},
  ]
},3000)

</script>

<template>
  <div class="app-page">
    <div>我是app</div>
    <ul>
      <li v-for="item in list" :key="item.id">{{item.name}}</li>
    </ul>
  </div>
</template>

<style lang="scss" scoped></style>
